package com.xckj.controller.run.intermethod;

import java.util.Map;

import javax.annotation.Resource;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.xckj.entity.MethodTree;
import com.xckj.service.QueryMethodTreeService;

/**
 * @description method_tree
 * @author yanchf
 * @date 2024-01-14
 */
@RestController
@RequestMapping(value = "/methodTree")
public class MethodTreeController {

    @Resource
    private QueryMethodTreeService methodTreeService;

    /**
    * 查询 分页查询
    * @author yanchf
    * @date 2024/01/14
    **/
    @RequestMapping("/pageList")
    public Map<String, Object> pageList(@RequestParam(required = false, defaultValue = "0") int offset,
                                        @RequestParam(required = false, defaultValue = "10") int pagesize) {
        return methodTreeService.pageList(offset, pagesize);
    }
    

    /**
    * 查询 分页查询
    * @author yanchf
    * @date 2024/01/14
    **/
    @RequestMapping("/children")
    public Map<String, Object> children(String methodName) {
        return methodTreeService.children(methodName);
    }

    /**
    * 查询 分页查询
    * @author yanchf
    * @date 2024/01/14
    **/
    @RequestMapping("/allData")
    public Map<String, Object> allData() {
        return methodTreeService.allData();
    }
    
    /**
    * 查询接口方法的明细
    * @author yanchf
    * @date 2023/12/03
    **/
    @RequestMapping("/detail")
    public Object detail(String functionName){
        return methodTreeService.detail(functionName);
    }    

}